package com.cdk8s.tkey.server.init;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class ApplicationHealthInitRunner implements ApplicationRunner {

//@Autowired
//private CustomUPMSApiServerHealthEndpoint customUPMSApiServerHealthEndpoint;

//    @Autowired
//    private ReactiveHealthIndicator redisReactiveHealthIndicator;

    @Override
    public void run(ApplicationArguments args) {
//http();
//        redis();
    }

//private void http() {
//Health customUPMSHealth = customUPMSApiServerHealthEndpoint.health();
//if (customUPMSHealth.getStatus().equals(Status.DOWN)) {
//log.error("启动请求 UPMS 接口失败");
//}
//}

//    private void redis() {
//        Mono<Health> redisHealth = redisReactiveHealthIndicator.health();
//        redisHealth.subscribe(h -> {
//            if (h.getStatus().equals(Status.DOWN)) {
//                log.error("启动连接 Redis 失败");
//            }
//        });
//    }
}
